import request from "@/request/request";
import qs from "qs"

 
export function getSchoolList(data){
    let url = "/admin/school";
    let param = {
        url:url,
        method:"GET",
        params:data
    }
    return request(param);
}



export function saveSchool(id,school){
    let method = "post";
    let url = "/admin/school";
    if(id){
        method = "put";
        url = "/admin/school";
    }

    let param = {
        url:url,
        method:method,
        data:qs.stringify(school)
    }
    return request(param);
}



export function findById(id){
    let param = {
        url:"/admin/school/"+id,
        method:"get"
    }
    return request(param);
}


export function deleteSchoolById(id){
    let param = {
        url:"/admin/school/"+id,
        method:"delete"
    }
    return request(param);
}



export function updateStatus(id,status){
    let param = {
        url:"/admin/school/"+id+"/" + status,
        method:"post"
    }
    return request(param);
}






export function login(loginInfo){
    let url = "/admin/school/login";
    let param = {
        url:url,
        method:"POST",
        data:qs.stringify(loginInfo)
    }
    return request(param);
}


